\(\int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx\) [155]

   Optimal result
   Rubi [B] (verified)
   Mathematica [A] (warning: unable to verify)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 52 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {(2 b+c x) \sqrt {-1+d x} \sqrt {1+d x}}{2 d^2}+\frac {\left (c+2 a d^2\right ) \text {arccosh}(d x)}{2 d^3} \]

[Out]

1/2*(2*a*d^2+c)*arccosh(d*x)/d^3+1/2*(c*x+2*b)*(d*x-1)^(1/2)*(d*x+1)^(1/2)/d^2

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(135\) vs. \(2(52)=104\).

Time = 0.06 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.60, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {915, 1829, 655, 223, 212} \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {\sqrt {d^2 x^2-1} \left (2 a d^2+c\right ) \text {arctanh}\left (\frac {d x}{\sqrt {d^2 x^2-1}}\right )}{2 d^3 \sqrt {d x-1} \sqrt {d x+1}}-\frac {b \left (1-d^2 x^2\right )}{d^2 \sqrt {d x-1} \sqrt {d x+1}}-\frac {c x \left (1-d^2 x^2\right )}{2 d^2 \sqrt {d x-1} \sqrt {d x+1}} \]

[In]

Int[(a + b*x + c*x^2)/(Sqrt[-1 + d*x]*Sqrt[1 + d*x]),x]

[Out]

-((b*(1 - d^2*x^2))/(d^2*Sqrt[-1 + d*x]*Sqrt[1 + d*x])) - (c*x*(1 - d^2*x^2))/(2*d^2*Sqrt[-1 + d*x]*Sqrt[1 + d
*x]) + ((c + 2*a*d^2)*Sqrt[-1 + d^2*x^2]*ArcTanh[(d*x)/Sqrt[-1 + d^2*x^2]])/(2*d^3*Sqrt[-1 + d*x]*Sqrt[1 + d*x
])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 655

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[e*((a + c*x^2)^(p + 1)/(2*c*(p + 1))),
x] + Dist[d, Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, p}, x] && NeQ[p, -1]

Rule 915

Int[((d_) + (e_.)*(x_))^(m_)*((f_) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :>
Dist[(d + e*x)^FracPart[m]*((f + g*x)^FracPart[m]/(d*f + e*g*x^2)^FracPart[m]), Int[(d*f + e*g*x^2)^m*(a + b*x
 + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && EqQ[m - n, 0] && EqQ[e*f + d*g, 0]

Rule 1829

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], e = Coeff[Pq, x, Expon[Pq, x]]}, Si
mp[e*x^(q - 1)*((a + b*x^2)^(p + 1)/(b*(q + 2*p + 1))), x] + Dist[1/(b*(q + 2*p + 1)), Int[(a + b*x^2)^p*Expan
dToSum[b*(q + 2*p + 1)*Pq - a*e*(q - 1)*x^(q - 2) - b*e*(q + 2*p + 1)*x^q, x], x], x]] /; FreeQ[{a, b, p}, x]
&& PolyQ[Pq, x] &&  !LeQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {-1+d^2 x^2} \int \frac {a+b x+c x^2}{\sqrt {-1+d^2 x^2}} \, dx}{\sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {c x \left (1-d^2 x^2\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\sqrt {-1+d^2 x^2} \int \frac {c+2 a d^2+2 b d^2 x}{\sqrt {-1+d^2 x^2}} \, dx}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {b \left (1-d^2 x^2\right )}{d^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {c x \left (1-d^2 x^2\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (\left (c+2 a d^2\right ) \sqrt {-1+d^2 x^2}\right ) \int \frac {1}{\sqrt {-1+d^2 x^2}} \, dx}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {b \left (1-d^2 x^2\right )}{d^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {c x \left (1-d^2 x^2\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (\left (c+2 a d^2\right ) \sqrt {-1+d^2 x^2}\right ) \text {Subst}\left (\int \frac {1}{1-d^2 x^2} \, dx,x,\frac {x}{\sqrt {-1+d^2 x^2}}\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {b \left (1-d^2 x^2\right )}{d^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {c x \left (1-d^2 x^2\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (c+2 a d^2\right ) \sqrt {-1+d^2 x^2} \tanh ^{-1}\left (\frac {d x}{\sqrt {-1+d^2 x^2}}\right )}{2 d^3 \sqrt {-1+d x} \sqrt {1+d x}} \\ \end{align*}

Mathematica [A] (warning: unable to verify)

Time = 0.13 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.21 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {d (2 b+c x) \sqrt {-1+d x} \sqrt {1+d x}+2 \left (c+2 a d^2\right ) \text {arctanh}\left (\sqrt {\frac {-1+d x}{1+d x}}\right )}{2 d^3} \]

[In]

Integrate[(a + b*x + c*x^2)/(Sqrt[-1 + d*x]*Sqrt[1 + d*x]),x]

[Out]

(d*(2*b + c*x)*Sqrt[-1 + d*x]*Sqrt[1 + d*x] + 2*(c + 2*a*d^2)*ArcTanh[Sqrt[(-1 + d*x)/(1 + d*x)]])/(2*d^3)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(95\) vs. \(2(44)=88\).

Time = 5.55 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.85

method result size
risch \(\frac {\left (c x +2 b \right ) \sqrt {d x -1}\, \sqrt {d x +1}}{2 d^{2}}+\frac {\left (2 a \,d^{2}+c \right ) \ln \left (\frac {x \,d^{2}}{\sqrt {d^{2}}}+\sqrt {d^{2} x^{2}-1}\right ) \sqrt {\left (d x +1\right ) \left (d x -1\right )}}{2 d^{2} \sqrt {d^{2}}\, \sqrt {d x -1}\, \sqrt {d x +1}}\) \(96\)
default \(\frac {\sqrt {d x -1}\, \sqrt {d x +1}\, \left (\sqrt {d^{2} x^{2}-1}\, \operatorname {csgn}\left (d \right ) d c x +2 \ln \left (\left (\sqrt {d^{2} x^{2}-1}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) a \,d^{2}+2 \,\operatorname {csgn}\left (d \right ) d \sqrt {d^{2} x^{2}-1}\, b +\ln \left (\left (\sqrt {d^{2} x^{2}-1}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) c \right ) \operatorname {csgn}\left (d \right )}{2 d^{3} \sqrt {d^{2} x^{2}-1}}\) \(120\)

[In]

int((c*x^2+b*x+a)/(d*x-1)^(1/2)/(d*x+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*(c*x+2*b)*(d*x-1)^(1/2)*(d*x+1)^(1/2)/d^2+1/2*(2*a*d^2+c)/d^2*ln(x*d^2/(d^2)^(1/2)+(d^2*x^2-1)^(1/2))/(d^2
)^(1/2)*((d*x+1)*(d*x-1))^(1/2)/(d*x-1)^(1/2)/(d*x+1)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.17 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {{\left (c d x + 2 \, b d\right )} \sqrt {d x + 1} \sqrt {d x - 1} - {\left (2 \, a d^{2} + c\right )} \log \left (-d x + \sqrt {d x + 1} \sqrt {d x - 1}\right )}{2 \, d^{3}} \]

[In]

integrate((c*x^2+b*x+a)/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="fricas")

[Out]

1/2*((c*d*x + 2*b*d)*sqrt(d*x + 1)*sqrt(d*x - 1) - (2*a*d^2 + c)*log(-d*x + sqrt(d*x + 1)*sqrt(d*x - 1)))/d^3

Sympy [F(-1)]

Timed out. \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\text {Timed out} \]

[In]

integrate((c*x**2+b*x+a)/(d*x-1)**(1/2)/(d*x+1)**(1/2),x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 90 vs. \(2 (44) = 88\).

Time = 0.19 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.73 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {a \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - 1} d\right )}{d} + \frac {\sqrt {d^{2} x^{2} - 1} c x}{2 \, d^{2}} + \frac {\sqrt {d^{2} x^{2} - 1} b}{d^{2}} + \frac {c \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - 1} d\right )}{2 \, d^{3}} \]

[In]

integrate((c*x^2+b*x+a)/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="maxima")

[Out]

a*log(2*d^2*x + 2*sqrt(d^2*x^2 - 1)*d)/d + 1/2*sqrt(d^2*x^2 - 1)*c*x/d^2 + sqrt(d^2*x^2 - 1)*b/d^2 + 1/2*c*log
(2*d^2*x + 2*sqrt(d^2*x^2 - 1)*d)/d^3

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.54 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {\sqrt {d x + 1} \sqrt {d x - 1} {\left (\frac {{\left (d x + 1\right )} c}{d^{2}} + \frac {2 \, b d^{5} - c d^{4}}{d^{6}}\right )} - \frac {2 \, {\left (2 \, a d^{2} + c\right )} \log \left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}{d^{2}}}{2 \, d} \]

[In]

integrate((c*x^2+b*x+a)/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="giac")

[Out]

1/2*(sqrt(d*x + 1)*sqrt(d*x - 1)*((d*x + 1)*c/d^2 + (2*b*d^5 - c*d^4)/d^6) - 2*(2*a*d^2 + c)*log(sqrt(d*x + 1)
 - sqrt(d*x - 1))/d^2)/d

Mupad [B] (verification not implemented)

Time = 12.84 (sec) , antiderivative size = 312, normalized size of antiderivative = 6.00 \[ \int \frac {a+b x+c x^2}{\sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {b\,\sqrt {d\,x-1}\,\sqrt {d\,x+1}}{d^2}+\frac {2\,c\,\mathrm {atanh}\left (\frac {\sqrt {d\,x-1}-\mathrm {i}}{\sqrt {d\,x+1}-1}\right )}{d^3}-\frac {4\,a\,\mathrm {atan}\left (\frac {d\,\left (\sqrt {d\,x-1}-\mathrm {i}\right )}{\left (\sqrt {d\,x+1}-1\right )\,\sqrt {-d^2}}\right )}{\sqrt {-d^2}}-\frac {\frac {14\,c\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^3}{{\left (\sqrt {d\,x+1}-1\right )}^3}+\frac {14\,c\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^5}{{\left (\sqrt {d\,x+1}-1\right )}^5}+\frac {2\,c\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^7}{{\left (\sqrt {d\,x+1}-1\right )}^7}+\frac {2\,c\,\left (\sqrt {d\,x-1}-\mathrm {i}\right )}{\sqrt {d\,x+1}-1}}{d^3-\frac {4\,d^3\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {d\,x+1}-1\right )}^2}+\frac {6\,d^3\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^4}{{\left (\sqrt {d\,x+1}-1\right )}^4}-\frac {4\,d^3\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^6}{{\left (\sqrt {d\,x+1}-1\right )}^6}+\frac {d^3\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^8}{{\left (\sqrt {d\,x+1}-1\right )}^8}} \]

[In]

int((a + b*x + c*x^2)/((d*x - 1)^(1/2)*(d*x + 1)^(1/2)),x)

[Out]

(2*c*atanh(((d*x - 1)^(1/2) - 1i)/((d*x + 1)^(1/2) - 1)))/d^3 - ((14*c*((d*x - 1)^(1/2) - 1i)^3)/((d*x + 1)^(1
/2) - 1)^3 + (14*c*((d*x - 1)^(1/2) - 1i)^5)/((d*x + 1)^(1/2) - 1)^5 + (2*c*((d*x - 1)^(1/2) - 1i)^7)/((d*x +
1)^(1/2) - 1)^7 + (2*c*((d*x - 1)^(1/2) - 1i))/((d*x + 1)^(1/2) - 1))/(d^3 - (4*d^3*((d*x - 1)^(1/2) - 1i)^2)/
((d*x + 1)^(1/2) - 1)^2 + (6*d^3*((d*x - 1)^(1/2) - 1i)^4)/((d*x + 1)^(1/2) - 1)^4 - (4*d^3*((d*x - 1)^(1/2) -
 1i)^6)/((d*x + 1)^(1/2) - 1)^6 + (d^3*((d*x - 1)^(1/2) - 1i)^8)/((d*x + 1)^(1/2) - 1)^8) - (4*a*atan((d*((d*x
 - 1)^(1/2) - 1i))/(((d*x + 1)^(1/2) - 1)*(-d^2)^(1/2))))/(-d^2)^(1/2) + (b*(d*x - 1)^(1/2)*(d*x + 1)^(1/2))/d
^2